#include "Inc/rlc.h"

void LCD_Init(void)
{
    LCD1602_Write(0x38, LCD_COMM);
    LCD1602_Write(0x0C, LCD_COMM);
    LCD1602_Write(0x06, LCD_COMM);
    LCD1602_Write(0x01, LCD_COMM);
    LCD1602_Write(0x80, LCD_COMM);
}

void LCD1602_DispString(uchar x, uchar y, uchar *s)
{
    LCD_Set_position(x, y);

    while(*s != '\0')
    {
        LCD1602_Write(*s, LCD_DATA);
        s++;
    }
}

void LCD1602_Write(uchar dat, uchar mode)
{
    RS = mode;
	RW = 0;
	Delay_ms(1);

    P0= dat;
	Delay_ms(1);

    En= 1;
    Delay_ms(10);
    En= 0;
}